import request from '@/utils/request'

// 查询用户优惠券列表
export function listUserCoupon(query) {
  return request({
    url: '/fun/userCoupon/list',
    method: 'get',
    params: query
  })
}

// 查询用户优惠券详细
export function getUserCoupon(userCouponId) {
  return request({
    url: '/fun/userCoupon/' + userCouponId,
    method: 'get'
  })
}

// 新增用户优惠券
export function addUserCoupon(data) {
  return request({
    url: '/fun/userCoupon',
    method: 'post',
    data: data
  })
}

// 修改用户优惠券
export function updateUserCoupon(data) {
  return request({
    url: '/fun/userCoupon',
    method: 'put',
    data: data
  })
}

// 删除用户优惠券
export function delUserCoupon(userCouponId) {
  return request({
    url: '/fun/userCoupon/' + userCouponId,
    method: 'delete'
  })
}

// 导出用户优惠券
export function exportUserCoupon(query) {
  return request({
    url: '/fun/userCoupon/export',
    method: 'post',
    params: query
  })
}

// 核验优惠券
export function verifyCoupon(data) {
  return request({
    url: '/fun/userCoupon/verify',
    method: 'post',
    data: data
  })
}
